package com.david.zhufengfm.widgets;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.ListView;

/**
 * Created by David on 2015/10/23.
 * qq:978944820
 */

/**
 * 自动扩充尺寸的ListView，适用于ScrollView+ListView
 */
public class FullListView extends ListView {
    public FullListView(Context context) {
        super(context);
    }

    public FullListView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        heightMeasureSpec=MeasureSpec.makeMeasureSpec(
                Integer.MAX_VALUE>>2,//size控件可以显示的最大高度
                MeasureSpec.AT_MOST
                );
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }


}
